package com.example.zhangyu.loadingapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.zhangyu.loadingapplication.indicators.BallSpinFadeLoaderIndicator;

/**
 * Created by Jack Wang on 2016/8/5.
 */

public class IndicatorActivity extends AppCompatActivity {

    private AVLoadingIndicatorView avi;

    private Button btn_daojishi;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_indicator);

//        String indicator = getIntent().getStringExtra("indicator");

//        Log.d("44444444444444", indicator);
//        BallSpinFadeLoaderIndicator
        avi = (AVLoadingIndicatorView) findViewById(R.id.avi);
//        avi.setIndicator(BallSpinFadeLoaderIndicator);
        BallSpinFadeLoaderIndicator indicator1 = new BallSpinFadeLoaderIndicator();
//        avi.setIndicatorColor(R.color.coloryellow);

        avi.setIndicator(indicator1);

        btn_daojishi = (Button) findViewById(R.id.btn_daojishi);
        btn_daojishi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(IndicatorActivity.this,DaojishiActivity.class));
            }
        });
    }

    public void hideClick(View view) {
        avi.hide();
        // or avi.smoothToHide();
    }

    public void showClick(View view) {
        avi.show();
        // or avi.smoothToShow();
    }
}
